<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{ backdrop: 'static', keyboard: !saving }">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="supplier.id">编辑供方信息</span>
                        <span *ngIf="!supplier.id">新增供方信息</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <tabset class="tab-container tabbable-line">
                        <tab heading="供方信息" customClass="m-tabs__item">
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="DisplayName">名称 *</label>
                                    <input id="DisplayName" #surnameInput="ngModel" type="text" name="DisplayName"
                                        class="form-control" [(ngModel)]="supplier.displayName" required
                                        maxlength="32" />
                                    <validation-messages [formCtrl]="surnameInput"></validation-messages>
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="ComplayAttribute">企业属性 *</label>
                                    <input id="ComplayAttribute" #complayAttributeInput="ngModel" type="text"
                                        name="ComplayAttribute" class="form-control"
                                        [(ngModel)]="supplier.complayAttribute" required maxlength="256" />
                                    <validation-messages [formCtrl]="complayAttributeInput"></validation-messages>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="Address">详细地址</label>
                                    <input id="Address" type="text" name="Address" class="form-control"
                                        [(ngModel)]="supplier.address" maxlength="24" />
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="Phone">联系电话 *</label>
                                    <input id="Phone" #phoneInput="ngModel" type="text" name="Portion"
                                        class="form-control" [(ngModel)]="supplier.phone" required maxlength="32" />
                                    <validation-messages [formCtrl]="phoneInput"></validation-messages>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="ProductRange">产品范围</label>
                                    <input id="ProductRange" type="text" name="ProductRange" class="form-control"
                                        [(ngModel)]="supplier.productRange" />
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="IsoStandard">质量管理体系标准</label>
                                    <input id="IsoStandard" type="text" name="IsoStandard" class="form-control"
                                        [(ngModel)]="supplier.isoStandard"  />
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="SubordinateUnit">隶属单位</label>
                                    <input id="SubordinateUnit" type="text" name="SubordinateUnit" class="form-control"
                                        [(ngModel)]="supplier.subordinateUnit" maxlength="24" />
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="Qualification">生产许可、承制资质</label>
                                    <input id="Qualification" type="text" name="Qualification" class="form-control"
                                        [(ngModel)]="supplier.qualification"  />
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="SupplierClass">合格供方分类</label>
                                    <p-dropdown [filter]="true" filterBy="label" name="SupplierClass"
                                        [options]="SupplierClassAyy" [(ngModel)]="supplier.supplierClass"
                                        [style]="{ width: '360px' }"></p-dropdown>
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="SupplierLevel">合格供方分级</label>
                                    <p-dropdown [filter]="true" filterBy="label" name="SupplierLevel"
                                        [options]="SupplierLevelAyy" [(ngModel)]="supplier.supplierLevel"
                                        [style]="{ width: '360px' }"></p-dropdown>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="Secret">涉及军方</label>
                                    <p-dropdown name="selectSecret" [options]="SecretAyy" [(ngModel)]="supplier.secret"
                                        (onChange)="secretchange($event)" [style]="{ width: '360px' }"></p-dropdown>
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="SecretLevel">保密资质</label>
                                    <p-dropdown [filter]="true" filterBy="label" name="SecretLevel"
                                        [options]="SecretLevelAyy"
                                        [(ngModel)]="supplier.secretLevel" [style]="{ width: '360px' }"></p-dropdown>
                                </div>
                            </div>
                        </tab>
                    </tabset>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary" [disabled]="!userForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <i class="fa fa-save"></i> <span>保存</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
